package com.example.starter;

import com.example.starter.verticle.RepositoryVerticle;
import com.example.starter.verticle.TCPVerticle;
import com.example.starter.verticle.WebVerticle;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.ThreadingModel;
import io.vertx.core.Vertx;

/**
 * @author yangkui
 */
public class Launcher {
  public static void main(String[] args) {
    var vertx = Vertx.vertx();
    var conf = vertx.fileSystem().readFileBlocking("conf.json").toJsonObject();
    var eventLoopOpts = new DeploymentOptions().setConfig(conf).setThreadingModel(ThreadingModel.EVENT_LOOP);
    var virtualThreadOpts = new DeploymentOptions().setConfig(conf).setThreadingModel(ThreadingModel.VIRTUAL_THREAD);

    vertx.deployVerticle(new WebVerticle(), eventLoopOpts);
    vertx.deployVerticle(new TCPVerticle(), eventLoopOpts);
    vertx.deployVerticle(new RepositoryVerticle(), virtualThreadOpts);

  }
}
